<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>我是div</div>
    <script>
        var oDiv = document.querySelector('div');
        var child = oDiv.childNodes[0];
        // 以下是文本节点操作内容 nodeValue
        console.dir(child);
        console.log(child.nodeValue);

        child.nodeValue = '你爱是不是！';

        // 通过元素操作内容更方便
        console.log('innerText',oDiv.innerText);
        console.log('innerHTML',oDiv.innerHTML);

        

    </script>
</body>
</html>